Skip to content

Add support for GKE Accelerator Network Profile#15474

Merged
melinath merged 48 commits intoGoogleCloudPlatform:mainfrom
ellenjzh:GKE-ANP-support
Jan 21, 2026
Merged

Add support for GKE Accelerator Network Profile#15474
melinath merged 48 commits intoGoogleCloudPlatform:mainfrom
ellenjzh:GKE-ANP-support

Conversation

@ellenjzh
Copy link
Member

@ellenjzh ellenjzh commented Oct 22, 2025

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

container: added `accelerator_network_config` field to `node_pool` resource

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@shuyama1

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@ellenjzh
Copy link
Member Author

PR Concerns & Justifications

This PR introduces support for the GKE Accelerator Network Profile (ANP) feature, for the GA release. There are two key changes that require special attention:

1. Change: additional_node_network_config from ForceNew to Computed

  • Justification: This change is essential for the ANP feature to function correctly. When a nodepool is created with an accelerator_network_profile, GKE automatically provisions an additional_node_network_config on the backend.

  • The Problem: If this attribute remains ForceNew, Terraform will detect a difference between the (empty) configuration and the auto-provisioned config returned by the API. This will cause any subsequent terraform apply or import to fail, as Terraform will try to recreate the resource.

  • The Solution: By changing this to Computed, we allow Terraform to acknowledge that this value is generated and managed by the GKE API after the resource is created. This resolves the persistent diff and allows the resource to be managed correctly.

  • On Missing Test Reports: This fundamental change to the attribute's behavior may impact existing acceptance tests for additional_node_network_config. I am seeking advice on the best path forward to update them.

2. Change: Alpha API Version Guard for accelerator_network_profile

  • Context: The GKE Accelerator Network Profile feature was announced for Public Preview (as of Oct 16th), but the corresponding accelerator_network_profile field is not available in the GKE V1 or V1Beta1 API track yet as of today.

  • The Action: Currently, in order to not trigger any V1 or V1Beta1 tests error, I marked the version guard flag as {{- if eq $.TargetVersionName "alpha" }} since "alpha" is not in any of the version guard categories.

  • Remaining Question: While waiting for the V1 API to be populated, I am seeking advice on the best path forward to correctly implement the ANP Terraform support.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is functioning correctly to me. In particular, when I remove the additional_node_network_configs block, it does trigger replacement. I just have a couple small changes to request to how tests are structured.

},
// Step 2: Remove Manual Config (Expect Replacement)
{
Config: testAccContainerCluster_nodePool_acceleratorNetworkProfile_basic(clusterName),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here & elsewhere: since it's important that the replacement is happening, it would be good to check that explicitly. (It's working now, but this will help ensure it doesn't get broken in the future.)

Suggested change
Config: testAccContainerCluster_nodePool_acceleratorNetworkProfile_basic(clusterName),
Config: testAccContainerCluster_nodePool_acceleratorNetworkProfile_basic(clusterName),
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace),
},
},

resource.TestCheckResourceAttr(resourceName, "node_pool.0.network_config.0.accelerator_network_profile", "auto"),
),
},
// Step 4: Import Verify
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than having one separate import verify step, there should be an import verify step after every config step.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, changed the tests. And also thank you for modifying the tests syntax as well!

@github-actions github-actions bot requested a review from melinath January 20, 2026 22:28
@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@github-actions github-actions bot requested a review from melinath January 20, 2026 23:31
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 5 files changed, 784 insertions(+))
google-beta provider: Diff ( 7 files changed, 1038 insertions(+))

Missing doc report (experimental)

The following resources have fields missing in documents.

  • google_container_cluster
    • Expected Document Path: /website/docs/r/container_cluster.html.markdown
    • Fields: [node_pool.network_config.accelerator_network_profile]

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 278
Passed tests: 261
Skipped tests: 15
Affected tests: 2

Click here to see the affected service packages
  • container

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccContainerCluster_nodePool_acceleratorNetworkProfile_Lifecycle
  • TestAccContainerNodePool_acceleratorNetworkProfile_Lifecycle

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccContainerCluster_nodePool_acceleratorNetworkProfile_Lifecycle [Debug log]
TestAccContainerNodePool_acceleratorNetworkProfile_Lifecycle [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, approving and merging!

@melinath melinath added this pull request to the merge queue Jan 21, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 9c56fcc Jan 21, 2026
22 of 24 checks passed
@KatrinaHoffert
Copy link
Member

@ellenjzh looks like a bunch of tests failed because of this (e.g., hashicorp/terraform-provider-google#25898 and similar). Was this submitted too soon? Not sure if this was ready to be usable yet.

@ellenjzh
Copy link
Member Author

@ellenjzh looks like a bunch of tests failed because of this (e.g., hashicorp/terraform-provider-google#25898 and similar). Was this submitted too soon? Not sure if this was ready to be usable yet.

I see the error here, GA tests didn't pass because I didn't add the GA version guards. The feature is only available in Beta. I will add the GA version guards to the tests now.

SirGitsalot pushed a commit that referenced this pull request Jan 28, 2026
Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
wuchris-g pushed a commit to wuchris-g/magic-modules that referenced this pull request Feb 5, 2026
…15474)

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
JianweiQ pushed a commit to JianweiQ/magic-modules that referenced this pull request Feb 20, 2026
…15474)

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
aditikumarii-google pushed a commit to aditikumarii-google/magic-modules that referenced this pull request Mar 10, 2026
…15474)

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants